package com.ten.jinxiancun.controller;

import com.ten.jinxiancun.server.impl.AlarmServerImpl;
import com.ten.jinxiancun.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
/*仓库报警 控制器*/
@RestController
    @RequestMapping("/Alarm")
public class AlarmController {
   @Autowired
    AlarmServerImpl ala;
   @RequestMapping("/getAllAlarm")
 public Object getAllAlarm(@RequestParam Map<String,Object> map){
       Integer page= Integer.parseInt(map.get("page").toString());
     Integer limit=Integer.parseInt(map.get("limit").toString());
       map.put("page",(page-1)*limit);
     map.put("limit",limit);

     Result res=new Result("0","true",ala.count(map),ala.getAllAlarm(map));
     return res;
 }
 @RequestMapping("/insert")
    public Object insert(@RequestParam Map<String,Object> map){
       Result res=new Result("0","true",ala.insert(map),null);
       return res;
 }

 /*下拉框 审核员显示*/
 @RequestMapping("/getAdminUser")
 public Object getAdminUser(@RequestParam Map<String,Object> map){
     Result res=new Result("0","true",10,ala.getAdminUserFind(map));
     return res;
 }
}
